package com.power.sifa.approve.model.enumeration;

import lombok.Getter;

/**
 * @ClassName Tp_classifyEnum
 * @Author xiongzw
 * @Date 2023/9/27 19:13
 * @Description
 * @Version: 1.0
 **/

@Getter
public enum Tp_classifyEnum {

    /**
     * 过程材料
     */
    MATERIAL("MATERIAL", Tp_classify.MATERIAL, "过程材料"),
    /**
     * 系统文书
     */
    DOCUMENT("DOCUMENT", Tp_classify.DOCUMENT, "系统文书"),
    /**
     * 过程材料和系统文书
     */
    MATANDDOC("MATANDDOC", Tp_classify.MATANDDOC, "过程材料和系统文书");


    private String key;

    private Integer id;

    private String name;


    Tp_classifyEnum(String key, int id, String name) {
        this.key = key;
        this.id = id;
        this.name = name;
    }


    public static Tp_classifyEnum getById(Integer id) {
        Tp_classifyEnum[] classifyEnums = Tp_classifyEnum.values();
        for (Tp_classifyEnum classifyEnum : classifyEnums) {
            if (classifyEnum.getId().equals(id)) {
                return classifyEnum;
            }
        }
        return null;
    }
}
